﻿Imports FL_8x0.Common.SystemData
Imports FL_8x0.Common.mdlDevice
Imports FL_8x0.Common.Database
Imports GalaSoft.MvvmLight.Threading

Class Application

    ' 应用程序级事件(例如 Startup、Exit 和 DispatcherUnhandledException)
    ' 可以在此文件中进行处理。

    Protected Overrides Sub OnStartup(ByVal e As StartupEventArgs)
        SystemInit()
        Current.StartupUri = New Uri("View/MainWindow.xaml", UriKind.Relative)
        DispatcherHelper.Initialize()
    End Sub

    Protected Overrides Sub OnExit(ByVal e As ExitEventArgs)
        StopServer()
        CloseDatabase()
        log.Dispose()
        If g_serialPort.IsOpen Then
            g_serialPort.Close()
        End If
    End Sub

End Class
